package simpleMesh;

import hdgeom.primitives.AbstractLine3D;
import processing.core.PVector;

public class Edge extends AbstractLine3D{
	public PVector n1,n2;
	public float x1(){
		return n1.x;
	}
	public float y1(){
		return n1.y;
	}
	public float z1(){
		return n1.z;
	}
	public float x2(){
		return n2.x;
	}
	public float y2(){
		return n2.y;
	}
	public float z2(){
		return n2.z;
	}
	public  Edge(){
		this.n1=new PVector();
		this.n2=new PVector();
	}
	public  Edge(PVector n1, PVector n2){
		this.n1=n1;
		this.n2=n2;
	}
	public  Edge(float x1,float y1,float z1,float x2,float y2,float z2){
		this.n1=new PVector(x1,y1,z1);
		this.n2=new PVector(x2,y2,z2);
	}
	
	public void invert(){
		PVector temp=n1;
		n1=n2;
		n2=temp;
	}
	@Override
	public void setPosition(int i, float x, float y, float z) {
		// TODO Auto-generated method stub
		if (i==0){
			n1.x=x;
			n1.y=y;
			n1.z=z;
			return;
		}
		if (i==1){
			n2.x=x;
			n2.y=y;
			n2.z=z;
		}
	}
}
